package com.cnd.scm.orm.repositoryproxy;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;

/**
 * @version V1.0
 * @ClassName: PhoenixRepositoryProxyRegister
 * @Description:
 * @author: 李启联
 * @date: 2020-05-29 14:34
 * @Copyright: Copyright (c), 2020
 */
public class PhoenixRepositoryProxyRegister implements BeanDefinitionRegistryPostProcessor {

    private String basePackge;

    public void setBasePackge(String basePackge) {
        this.basePackge = basePackge;
    }

    public PhoenixRepositoryProxyRegister(String basePackage) {
        this.basePackge = basePackage;
    }


    @Override
    public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry) throws BeansException {
        if (StringUtils.isBlank(basePackge)) {
            return;
        }
        InterfaceScanner scanner=new InterfaceScanner(beanDefinitionRegistry);
        scanner.scan(basePackge);
    }

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {

    }
}